<?php
$taskId=$_GET['task_id']??'';
$dsn = "sqlsrv:Server=localhost;Database=Task";
$db = new PDO($dsn, "sa", "123456");

$sql = "delete Task where TaskId='{$taskId}'";
$result = $db->exec($sql);
if ($result){
    echo "删除成功，前往<a href='list.php'>列表页</a>查看";
}else{
    echo "删除失败";
}